<?php

Route::get('/', function () {
    return view('home.index');
});
Route::post('/home/article/article/gets','Home\Article\ArticleController@gets'); //获取所有文章
Route::post('/home/article/article/get','Home\Article\ArticleController@get'); //获取指定文章
Route::get('/home/article/article/count','Home\Article\ArticleController@count'); //获取文章总数
Route::get('/home/article/article/hots','Home\Article\ArticleController@hots'); //获取热门文章
Route::get('/home/article/category/gets','Home\Article\CategoryController@gets');//分类获取
Route::post('/home/article/reply/gets','Home\Article\ReplyController@gets');//获取文章回复


Route::post('/home/car/getCarWf','Home\CarInfoController@getCarWf');//分类获取
Route::post('/home/car/getJsrWf','Home\CarInfoController@getJsrWf');//分类获取
Route::post('/home/car/getJsrInfo','Home\CarInfoController@getJsrInfo');//分类获取



Route::post('/home/chat/user','Home\Chat\UserController@user');//发送进入聊天用户的名称
Route::post('/home/chat/user/gets','Home\Chat\UserController@gets');//发送进入聊天用户的名称


//Route::get('/home/test','Home\TestController@index');//分类获取
#########################后台##############################################

Route::post('/admin/login/login','Admin\LoginController@login');
Route::post('/admin/login/check','Admin\LoginController@check');
Route::get('/admin/test','Admin\TestController@index');
Route::group(['middleware'=>'AdminAuth'],function (){
    Route::get('/admin', function () {
        return view('admin.index');
    });
    Route::post('/admin/user/curr','Admin\UserController@curr'); //当前登陆用户
    Route::post('/admin/user/gets','Admin\UserController@gets');//所有用户
    Route::post('/admin/user/count','Admin\UserController@count');//用户数量

    Route::post('/admin/article/category/gets','Admin\Article\CategoryController@gets');//分类获取
    Route::post('/admin/article/category/add','Admin\Article\CategoryController@add');//分类标签
    Route::post('/admin/article/category/del','Admin\Article\CategoryController@del');//分类删除

    Route::post('/admin/article/article/add','Admin\Article\ArticleController@add');//文章添加
    Route::post('/admin/article/article/gets','Admin\Article\ArticleController@gets');//获取所有文章
    Route::post('/admin/article/article/get','Admin\Article\ArticleController@get');//获取指定文章
    Route::get('/admin/article/article/count','Admin\Article\ArticleController@count');//获取所有文章
    Route::post('/admin/article/article/del','Admin\Article\ArticleController@del');//获取所有文章
    Route::post('/admin/article/article/edit','Admin\Article\ArticleController@edit');//获取所有文章
    Route::post('/admin/upload/addimg','Admin\UploadController@addImg');//图片上传
    Route::get('/admin/upload/addfile','Admin\UploadController@addFile');//文件上传
});
